import unittest
import requests

from 新建文件夹.api.login_API import ihrm_login
from 新建文件夹.common import common


class TestIHRMLogin(unittest.TestCase):


    # 登录成功
    def test01_login_success(self):
        json_data = {"mobile":"13800000002","password":"123456"}
        resp = ihrm_login.login(json_data)

        # self.assertEqual(200,resp.status_code)
        # self.assertEqual(True,resp.json().get("success"))
        # self.assertEqual(10000,resp.json().get("code"))
        # self.assertIn("操作成功",resp.json().get("message"))
        common(self,resp,200,True,10000,"操作成功")
    def test02_mobile_not_exist(self):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/login",
                             json={"mobile": "13933000002", "password": "123456"})

        common(self,resp,200,False,20001,"用户名或密码错误")

